import { AccountService } from './../services/account';
import { Component, OnInit } from '@angular/core';
@Component({
  selector: 'ree-list',
  templateUrl: './list.component.html',
  styleUrls: ['./list.component.scss']
})
export class ListComponent implements OnInit {

  isVisible = false;
  accountName:string;
  selectedOption;
  searchOptions = [
    { label: '产品设置', value: '产品设置' },
    { label: '预警设置', value: '预警设置' },
    { label: '设备列表', value: '设备列表' }
  ];

  filter = {
    accountName: '',
    delarAccounts: '',
    accountStatus: 'A',
  }
  accountsList = [];
  constructor(private AccountService: AccountService) { }

  ngOnInit() {
    this.getAccountsList()
  }

  private getAccountsList() {
    this.AccountService.getAccountList().then(data => this.accountsList = data)
  }

  createAccount = () => {
    this.isVisible = true;
  }

  handleOk = (e) => {
    console.log('点击了确定');
    this.isVisible = false;
  }

  handleCancel = (e) => {
    console.log(e);
    this.isVisible = false;
  }

}
